<template>
	<div class="favorite-star">
		<i
			class="icon"
			:class="{'fdx-icons-star2 favorited': !!favorited, 'fdx-icons-star2': !!!favorited, [`favorite-${type}`]: true}"
		></i>
	</div>
</template>

<script>
export default {
	props: {
		value: {
			type: Boolean | Number,
			default: false
		},
		type: {
			type: String,
			default: "white"
		}
	},
	data() {
		return {
			favorited: false
		};
	},
	methods: {},
	watch: {
		value(val) {
			this.favorited = val;
		}
	}
};
</script>

<style lang="scss" scoped>
@import "../../assets/sass/_vars";
.favorite-star {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;

	.icon {
		flex-grow: 1;
		height: 100%;
		display: flex;
		align-items: center;
		justify-content: center;

		&.favorited {
			&::before {
				font-size: 26px;
				color: #fb3353;
			}
		}

		&::before {
			font-size: 26px;
		}
	}

	.favorite-white {
		color: white;
	}

	.favorite-gray {
		color: $primary;
	}
}
</style>
